package com.gk.kafkaproduce.controller;

import com.gk.kafkaproduce.service.MyProduceTestService;
import com.gk.kafkaproduce.service.ProduceTestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProduceController {

    @Autowired
    private ProduceTestService produceTestService;
    @Autowired
    private MyProduceTestService myProduceTestService;

    @RequestMapping("/send/{msg}")
    public void sendKafkaMsgTest(@PathVariable("msg") String msg){
        System.out.println("收到消息:"+msg);
        produceTestService.sendMsg(msg);
    }

    @RequestMapping("/mySend/{msg}")
    public void sendMyKafkaMsgTest(@PathVariable("msg") String msg){
        System.out.println("收到消息:"+msg);
        myProduceTestService.sendMsg(msg);
    }

}
